<?php
	require ("header.php");
	//include ("../config/conn.php");
	if($ad_check<1){
	header ("Location:../login.php?action=0");
	}
?>

<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #000000;
}
.style1 {
	font-size: 18px;
	font-weight: bold;
	color: #000000;
}
.style6 {color: #000000; }
.style7 {
	color: #FFFFFF;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
}
.style8 {color: #FF0000}
.style9 {color: #FF0000; font-size: 12px; }
-->
</style></head>
<?php
	$intruder=0;
	if (isset($_GET['sub'])) {
		$sub = $_GET['sub'];
	} else { $intruder=1; }
	if (isset($_GET['dep'])) {
		$dep = $_GET['dep'];
	} else { $intruder=1; }
	if (isset($_GET['sem'])) {
		$sem = $_GET['sem'];
	} else { $intruder=1; }
	if (isset($_GET['course'])) {
		$course = $_GET['course'];
	} else { $intruder=1; }
	if (isset($_GET['quiz'])) {
		$quiz = $_GET['quiz'];
	} else { $intruder=1; }
	if (isset($_GET['class'])) {
		$class = $_GET['class'];
	} else { $intruder=1; }
	if ($intruder==1) { ?>
		<p>&nbsp;</p>
 	 	<p>&nbsp;</p>
 	 	<p>&nbsp;</p><center>
 	 	<table width="780" border="1" bordercolor="#999999" bgcolor="#999999">
    		<tr>
      		  <td bgcolor="#000000"><div align="center">
      		    <p class="style8">&nbsp;</p>
      		    <p class="style9">You cannot access this page directly.</p>
      		    <p class="style8">&nbsp; </p>
      		  </div></td>
    		</tr>
 		 </table></center>
		 <p>&nbsp;</p>
 	 	<p>&nbsp;</p>
 	 	<p>&nbsp;</p>
		
	<?php require_once ("footer.php"); exit(); } 
?>
<div align="center">
  <table width="600" border="0" bordercolor="#000000">
  <form name="question_reg" method="POST" action="engine/quiz_reg_engine.php">
    <tr>
      <td bgcolor="#FFFFFF"><p align="center" class="style1">QUIZZES CREATOR FORM </p>
        <table width="553" border="0" align="center">
          <tr>
            <td width="181" valign="top"><div align="left" class="style6">Subject</div></td>
            <td width="36" valign="top"><div align="left" class="style6">:</div></td>
            <td width="322" valign="top"><div align="left" class="style6">
              <select name="sub" id="sub">
			  <?php 
			  $sql_get_sub="SELECT sub_name,sub_code FROM subject WHERE sub_code='$sub'";
			  $get_sub=mysql_query($sql_get_sub);
			  while ($sub = mysql_fetch_assoc($get_sub)) { ?>
                <option value="<?php echo $sub['sub_code']; ?>"><?php echo $sub['sub_name']; ?></option>
                  <?php } ?>
              </select>
              </div></td>
          </tr>
          <tr>
            <td valign="top"><div align="left" class="style6">Department</div></td>
            <td valign="top"><div align="left" class="style6">:</div></td>
            <td valign="top"><div align="left" class="style6">
              <select name="dep" id="dep">
			  <?php 
			  $sql_get_dep="SELECT dep_name,dep_code FROM deparment WHERE dep_code='$dep'";
			  $get_dep=mysql_query($sql_get_dep);
			  while ($dep = mysql_fetch_assoc($get_dep)) { ?>
                <option value="<?php echo $dep['dep_code']; ?>"><?php echo $dep['dep_name']; ?></option>
                  <?php } ?>
              </select>
            </div></td>
          </tr>
          <tr valign="top">
            <td><div align="left" class="style6">Course</div></td>
            <td><div align="left" class="style6">:</div></td>
            <td><div align="left" class="style6">
              <select name="course" id="course">
			  <?php 
			  $sql_get_course="SELECT course_name,course_code FROM course WHERE course_code='$course'";
			  $get_course=mysql_query($sql_get_course);
			  while ($course = mysql_fetch_assoc($get_course)) { ?>
                <option value="<?php echo $course['course_code']; ?>"><?php echo $course['course_name']; ?></option>
                  <?php } ?>
              </select>
              </div></td>
          </tr>
          <tr>
            <td valign="top"><div align="left" class="style6">Semester</div></td>
            <td valign="top"><div align="left" class="style6">:</div></td>
            <td valign="top"><div align="left" class="style6">
              <select name="sem" id="sem" >
			  	 <option value="<?php echo $sem; ?>"><?php echo $sem; ?></option>
              </select>
            </div></td>
          </tr>
          <tr>
            <td valign="top"><span class="style6">Class</span></td>
            <td valign="top"><span class="style6">:</span></td>
            <td valign="top"><span class="style6">
              <select name="class" id="class">
                <option value="<?php echo $class; ?>"><?php echo $class; ?></option>
              </select>
            </span> </td>
          </tr>
          <tr>
            <td valign="top"><div align="left" class="style6">Quizzes Number </div></td>
            <td valign="top"><div align="left" class="style6">:</div></td>
            <td valign="top"><div align="left" class="style6">
              <input name="quiz" type="text" id="quiz" size="1" maxlength="1" value="<?php echo $quiz; ?>"/>
            </div></td>
          </tr>
          <tr>
            <td valign="top"><div align="left" class="style6">Question</div></td>
            <td valign="top"><div align="left" class="style6">:</div></td>
            <td valign="top"><div align="left" class="style6">
              <textarea name="question" cols="38" rows="5" id="question"></textarea>
            </div></td>
          </tr>
          <tr valign="middle">
            <td colspan="3"><div align="left" class="style6">
              <hr />
            </div>              <div align="left" class="style6"></div>              <div align="left" class="style6"></div></td>
            </tr>
          <tr valign="top">
            <td valign="top"><div align="left" class="style6">
              <p>Answer</p>
              </div></td>
            <td valign="top"><p class="style6">:</p>            </td>
            <td valign="top"><p align="left" class="style6">
                <input name="answer1" type="text" id="answer1" size="20" />
                This should be the answer.</p>
              <p align="left" class="style6">
                <input name="answer2" type="text" id="answer2" size="20" /> 
                This is the wrong answer.</p>
              <p align="left" class="style6">
                <input name="answer3" type="text" id="answer3" size="20" />
              This is the wrong answer.</p>
              <p align="left" class="style6">
                <input name="answer4" type="text" id="answer4" size="20" /> 
              This is the wrong answer.</p></td>
          </tr>
        </table>
        <p align="center">
          <input type="submit" name="Submit" value="Submit" />
          &nbsp;&nbsp;
          <input type="reset" name="Submit2" value="Reset" />
        </p>
        <p align="center">&nbsp;</p>      </td>
    </tr>
	</form>
  </table>
  <p>&nbsp;</p>
</div>
<span class="style7">
<?php require ("footer.php"); ?>
</span>